﻿using Common;
using Network.UpdateData;
using System.Net.Sockets;

namespace SFJDService.SocketHandle
{
    class PH04EditUser : PacketHandle
    {
        public PH04EditUser(Socket socket, Packet packet) : base(socket, packet)
        {
        }

        protected override void Handle()
        {
            ClassConfig config = new ClassConfig();
            config.DecodingFromString(Message);
            if(Runtime.thisUser.UserGuid == config.UserGuid)
            {
                Runtime.thisUser.Copy(config);
                Runtime.xmlConfig.SetConfig(config);
            }
            Runtime.xmlUsers.EditUser(config);
        }
    }
}
